from selenium.webdriver.support.wait import WebDriverWait


def find_element(wd,find_type,expression):
    try:
        element = WebDriverWait(20,wd).until(lambda wd:wd.find_element(by=find_type,value=expression))
        return element
    except Exception as e:
        print(e)

def find_elements(wd,find_type,expression):
    try:
        elements = WebDriverWait(20,wd).until(lambda wd:wd.find_elements(by=find_type,value=expression))
        return elements
    except Exception as e:
        print(e)
